<template>
  <div class="dashboard-container">
    <div class="app-container">
      <el-card shadow="never">
        <!-- 精选题库 -->
       <QuesTionsl></QuesTionsl>
        <el-table :data="list" border style="width: 100%">
          <el-table-column prop="number" label="试题编号" width="150"></el-table-column>
          <el-table-column prop="subject" label="学科" width="120"></el-table-column>
          <el-table-column prop="catalog" label="目录" width="120"></el-table-column>
          <el-table-column prop="questionType" label="题型" width="120">
            <template v-slot="{row}">
              <span>{{row.questionType===1?"单选":"单选" }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="answer" label="题干" width="280">
            <template v-slot="{row}">
              <span v-html="row.answer"></span>
            </template>
          </el-table-column>
          <el-table-column prop="addDate" label="录入时间" width="180">
             <template v-slot="{row}">
            <span>{{$moment (row.addDate).format("YYYY-MM-DD HH:MM:SS")}} </span>
          </template>
          </el-table-column>
          <el-table-column prop="difficulty" label="难度" width="120"></el-table-column>
          <el-table-column prop="creator" label="录入人" width="120"></el-table-column>
          <el-table-column prop="chkState" label="审核状态" width="120"></el-table-column>
          <el-table-column prop="chkRemarks" label="审核意见" width="150"></el-table-column>
          <el-table-column prop="chkUser" label="审核人" width="120"></el-table-column>
          <el-table-column prop="chkState" label="发布状态" width="120">
            <template v-slot="{row}">
               <span v-if="row.chkState===0">待审核</span>
               <span v-else-if="row.chkState===1"> 通过</span>
               <span v-else>拒绝</span>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="200">
      <template>
        <el-button type="text" size="small">预览</el-button>
        <el-button type="text" size="small">审核</el-button>
        <el-button type="text" size="small">修改</el-button>
        <el-button type="text" size="small">上架</el-button>
        <el-button type="text" size="small">删除</el-button>
      </template>
          </el-table-column>
  </el-table>
      </el-card>
    </div>
  </div>
</template>

<script>
import QuesTionsl from './companys/QuesTionsl.vue'
import { choice } from '@/api/hmmm/questions'
export default {
  components: {
    QuesTionsl
  },
  data () {
    return {
      list: [],
      choicelist: {
        page: 1,
        pagesize: 10,
        username: '' // 录入人
      }
    }
  },
  created () {
    this.choice()
  },
  methods: {
    async choice () {
      const res = await choice(this.choicelist)
      this.list = res.data.items
      console.log(res.data.items)
    }
  }
}
</script>

<style scoped></style>
